#include<owl\framewin.h>
struct Coord
{
 int x;
 int y;
};

class TCorners
{
  TClientDC*dc;
  TWindow* parent;
  HINSTANCE inst;
  TBitmap* deskBMP;
  TBitmap* blackBMP;
  TBitmap* whiteBMP;
  TBitmap* kletkaBMP;
  TBitmap* newBlackBMP;
  TBitmap* oldKletkaBMP;
  TBitmap* BMPs[20];
  int deepness;
  int flagPlay;
  int oldCompX,oldCompY,newCompX,newCompY;
  int oldMyX,oldMyY,newMyX,newMyY;
  int desk[8][8];
  Coord from;
  int count;
  Coord to;
  int flagUp;
  int way;
  int WayViaFigura(int a,int b,int c,int d,int m[8][8]);
  int IsWayFromTo(int a,int b,int c,int d,int m[8][8]);
  int CreateChild(int fmX,int fmY,int toX,int toY,int mas[8][8],int deep,int MinMax,int alpha);
  int HasWay();
  void Go();
 public:
  void SetDeepness(int d);
  void Undo();
  void Play(int);
  TCorners(TWindow*p,HINSTANCE);
  ~TCorners();
  int IsEnd(int m[8][8]);
  int IsEnd(){return IsEnd(desk);};
  int FlagPlay(){return flagPlay;}
  void Restart();
  void From(int x,int y);
  void To(int x,int y);
  void Draw();
  void Jump();
  int GetWay(int&oldX,int&oldy,int&newX,int&newY);
  void CompGo();
  int  WayIs(){return way;}
  void WayOn(){way=1;}
  void WayOff(){way=0;}
};
